package com.groupYLP.CouponNexus.settlement.common.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 优惠劵类型
 */
@RequiredArgsConstructor
public enum DiscountTypeEnum {

    /**
     * 立减劵
     */
    LJ(0, "立减劵"),

    /**
     * 满减劵
     */
    MJ(1, "满减劵"),

    /**
     * 折扣劵
     */
    ZK(2, "折扣劵");

    @Getter
    private final int type;

    @Getter
    private final String value;

    public static String findValueByType(int type) {
        for (DiscountTypeEnum disCountTypeEnum : DiscountTypeEnum.values()) {
            if (disCountTypeEnum.type == type) {
                return disCountTypeEnum.value;
            }
        }
        throw new IllegalArgumentException();
    }

}
